<template>
	<div>
		<OrderQueryBar @onSearch="search"/>
		<van-list class="order-list" v-if="orderList&&orderList.length>0"
				  :finished="pager.finished" v-model:loading="pager.loading" v-model:error="pager.error" error-text="请求失败，点击重新加载">
			<template #finished><van-divider>没有更多了</van-divider></template>
			<OrderItem v-for="ord in orderList" :key="ord.orderId" :order="ord"/>
		</van-list>
		<van-empty v-else description="很抱歉，暂无结果~" />
	</div>
</template>
<style lang="scss" scoped>
.order-list{padding-bottom:10px;}
</style>
<script lang="ts" setup>
//data
const route=useRoute()
const {pager} =useSearch()

//data
const orderList=ref([
	{
		orderId:'1234567889',
		orderFrom: '0',
		orderTime:'2023-12-29 15:30:50',
		realMoney: 9960000,
		shippingMoney: 10000,
		status: '01',
		shopId: 'AMBL5389',
		shopName: '安部雷拉全球旗舰店',
		shopType: '0',
		//子订单信息
		ordSubs: [
			{
				subId: '111111',
				status: '01',
				payMoney: 530000,
				gdsId: '53322',
				gdsName: '病毒战机机械键盘DSFSADGWREWRE病毒战机机械键盘DSFSADGWREWRE',
				skuId: '533221',
				skuInfo: '邪恶黑/104键/TTC茶轴',
				picture: 'https://cbu01.alicdn.com/img/ibank/O1CN01ovWTVF1s49Aih2S1Y_!!3216375712-0-cib.220x220.jpg?_=2020',
				orderAmount:10,
				skuUnitPrice:53000,
			},
			{
				subId: '222222',
				status: '01',
				payMoney: 1250000,
				gdsId: '53324',
				gdsName: '病毒坦克杀手机械键盘BSAABSAABSAA病毒坦克杀手机械键盘BSAA',
				skuId: '533242',
				skuInfo: '战地灰/61键/cherry静音红轴',
				picture: 'https://cbu01.alicdn.com/img/ibank/O1CN01kQ8BaS1pc5hHlMYT1_!!3463595380-0-cib.220x220xz.jpg?_=2020',
				orderAmount:20,
				skuUnitPrice:63000,
			},
		],
	},
	{
		orderId:'1234567890',
		orderFrom: '1',
		orderTime:'2023-12-29 15:30:50',
		realMoney: 9960000,
		shippingMoney: 10000,
		status: '02',
		shopId: 'AMBL5389',
		shopName: '安部雷拉全球旗舰店',
		shopType: '2',
		//子订单信息
		ordSubs: [
			{
				subId: '111111',
				status: '02',
				payMoney: 530000,
				gdsId: '53322',
				gdsName: '病毒战机机械键盘DSFSADGWREWRE病毒战机机械键盘DSFSADGWREWRE',
				skuId: '533221',
				skuInfo: '邪恶黑/104键/TTC茶轴',
				picture: 'https://cbu01.alicdn.com/img/ibank/O1CN01ovWTVF1s49Aih2S1Y_!!3216375712-0-cib.220x220.jpg?_=2020',
				orderAmount:10,
				skuUnitPrice:53000,
			},
			{
				subId: '222222',
				status: '02',
				payMoney: 1250000,
				gdsId: '53324',
				gdsName: '病毒坦克杀手机械键盘BSAABSAABSAA病毒坦克杀手机械键盘BSAA',
				skuId: '533242',
				skuInfo: '战地灰/61键/cherry静音红轴',
				picture: 'https://cbu01.alicdn.com/img/ibank/O1CN01kQ8BaS1pc5hHlMYT1_!!3463595380-0-cib.220x220xz.jpg?_=2020',
				orderAmount:20,
				skuUnitPrice:63000,
			},
		],
	},
	{
		orderId:'1234567896',  //注意，此demo中该订单为部分子订单已发货，其余非发货
		orderFrom: '1',
		orderTime:'2023-12-29 15:30:50',
		realMoney: 9960000,
		shippingMoney: 10000,
		status: '04',
		shopId: 'AMBL5389',
		shopName: '安部雷拉全球旗舰店',
		shopType: '2',
		//子订单信息
		ordSubs: [
			{
				subId: '111111',
				status:'02',
				payMoney: 530000,
				gdsId: '53322',
				gdsName: '病毒战机机械键盘DSFSADGWREWRE病毒战机机械键盘DSFSADGWREWRE',
				skuId: '533221',
				skuInfo: '邪恶黑/104键/TTC茶轴',
				picture: 'https://cbu01.alicdn.com/img/ibank/O1CN01ovWTVF1s49Aih2S1Y_!!3216375712-0-cib.220x220.jpg?_=2020',
				orderAmount:10,
				skuUnitPrice:53000,
			},
			{
				subId: '222222',
				status:'05',
				payMoney: 1250000,
				gdsId: '53324',
				gdsName: '病毒坦克杀手机械键盘BSAABSAABSAA病毒坦克杀手机械键盘BSAA',
				skuId: '533242',
				skuInfo: '战地灰/61键/cherry静音红轴',
				picture: 'https://cbu01.alicdn.com/img/ibank/O1CN01kQ8BaS1pc5hHlMYT1_!!3463595380-0-cib.220x220xz.jpg?_=2020',
				orderAmount:20,
				skuUnitPrice:63000,
			},
		],
	},
	{
		orderId:'1234567891',
		orderFrom: '2',
		orderTime:'2023-12-29 15:30:50',
		realMoney: 9960000,
		shippingMoney: 10000,
		status: '05',
		shopId: 'AMBL5389',
		shopName: '安部雷拉全球旗舰店',
		shopType: '4',
		//子订单信息
		ordSubs: [
			{
				subId: '111111',
				status:'05',
				payMoney: 530000,
				gdsId: '53322',
				gdsName: '病毒战机机械键盘DSFSADGWREWRE病毒战机机械键盘DSFSADGWREWRE',
				skuId: '533221',
				skuInfo: '邪恶黑/104键/TTC茶轴',
				picture: 'https://cbu01.alicdn.com/img/ibank/O1CN01ovWTVF1s49Aih2S1Y_!!3216375712-0-cib.220x220.jpg?_=2020',
				orderAmount:10,
				skuUnitPrice:53000,
			},
			{
				subId: '222222',
				status:'05',
				payMoney: 1250000,
				gdsId: '53324',
				gdsName: '病毒坦克杀手机械键盘BSAABSAABSAA病毒坦克杀手机械键盘BSAA',
				skuId: '533242',
				skuInfo: '战地灰/61键/cherry静音红轴',
				picture: 'https://cbu01.alicdn.com/img/ibank/O1CN01kQ8BaS1pc5hHlMYT1_!!3463595380-0-cib.220x220xz.jpg?_=2020',
				orderAmount:20,
				skuUnitPrice:63000,
			},
		],
	},
	{
		orderId:'1234567892',
		orderFrom: '3',
		orderTime:'2023-12-29 15:30:50',
		realMoney: 9960000,
		shippingMoney: 0,
		status: '06',
		shopId: 'AMBL5389',
		shopName: '安部雷拉全球旗舰店',
		shopType: '5',
		//子订单信息
		ordSubs: [
			{
				subId: '111111',
				status: '06',
				payMoney: 530000,
				gdsId: '53322',
				gdsName: '病毒战机机械键盘DSFSADGWREWRE病毒战机机械键盘DSFSADGWREWRE',
				skuId: '533221',
				skuInfo: '邪恶黑/104键/TTC茶轴',
				picture: 'https://cbu01.alicdn.com/img/ibank/O1CN01ovWTVF1s49Aih2S1Y_!!3216375712-0-cib.220x220.jpg?_=2020',
				orderAmount:10,
				skuUnitPrice:53000,
			},
			{
				subId: '222222',
				status: '06',
				payMoney: 1250000,
				gdsId: '53324',
				gdsName: '病毒坦克杀手机械键盘BSAABSAABSAA病毒坦克杀手机械键盘BSAA',
				skuId: '533242',
				skuInfo: '战地灰/61键/cherry静音红轴',
				picture: 'https://cbu01.alicdn.com/img/ibank/O1CN01kQ8BaS1pc5hHlMYT1_!!3463595380-0-cib.220x220xz.jpg?_=2020',
				orderAmount:20,
				skuUnitPrice:63000,
			},
		],
	},
	{
		orderId:'1234567898',
		orderFrom: '3',
		orderTime:'2023-12-29 15:30:50',
		realMoney: 9960000,
		shippingMoney: 0,
		status: '99',
		shopId: 'AMBL5389',
		shopName: '安部雷拉全球旗舰店',
		shopType: '5',
		//子订单信息
		ordSubs: [
			{
				subId: '111111',
				status: '99',
				payMoney: 530000,
				gdsId: '53322',
				gdsName: '病毒战机机械键盘DSFSADGWREWRE病毒战机机械键盘DSFSADGWREWRE',
				skuId: '533221',
				skuInfo: '邪恶黑/104键/TTC茶轴',
				picture: 'https://cbu01.alicdn.com/img/ibank/O1CN01ovWTVF1s49Aih2S1Y_!!3216375712-0-cib.220x220.jpg?_=2020',
				orderAmount:10,
				skuUnitPrice:53000,
			},
			{
				subId: '222222',
				status: '90',
				payMoney: 1250000,
				gdsId: '53324',
				gdsName: '病毒坦克杀手机械键盘BSAABSAABSAA病毒坦克杀手机械键盘BSAA',
				skuId: '533242',
				skuInfo: '战地灰/61键/cherry静音红轴',
				picture: 'https://cbu01.alicdn.com/img/ibank/O1CN01kQ8BaS1pc5hHlMYT1_!!3463595380-0-cib.220x220xz.jpg?_=2020',
				orderAmount:20,
				skuUnitPrice:63000,
			},
		],
	},
])

//methods
const search=(cond: any)=>{
	//todo: 异步实现瀑布流分页查询的方法调用，传入cond
	console.log('fetchData',cond)
}

</script>